<%--
    Document   : sanpham_sua
    Created on : Dec 1, 2011, 5:05:58 PM
    Author     : kydrenw
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<div class="box-head">Thay Đổi Thông Tin Sản Phẩm</div>
<form action="sanpham.htm" method="post" name="frm_suasp" id="frm_suasp" class="infoForm">
    <div class="info">
        <span class="label">Tên sản phẩm</span>
        <span><input name="txttensp" type="text" id="txttensp" value="${sanpham.tensp}" size="30"/></span>
    </div>

    <div class="info">
        <span class="label">Giá sản phẩm</span>
        <span><input name="txtgia" type="text" id="txtgia" value="${sanpham.gia}"/></span>
    </div>

    <div class="info">
        <span class="label">Số lượng tồn</span>
        <span><input name="txtsoluong" type="text" id="txtsoluong" value="${sanpham.soluongton}"/></span>
    </div>

    <div class="info">
        <span class="label">Danh mục</span>
        <span>
            <select name="txtdanhmuc" id="danhmuc" onchange="return frm_suasp.submit()">
                <c:forEach var="item" items="${dsDanhMuc}">
                    <option value="${item.ma}"
                            <c:if test="${item.ma == danhmucSel.ma}">
                                selected="selected"
                            </c:if>
                            >${item.ten}</option>
                </c:forEach>
            </select>
        </span>
    </div>

    <div class="info">
        <span class="label">Loại sản phẩm</span>
        <span>
            <select name="txtloaisp" id="txtloaisp">
                <c:forEach var="item" items="${dsLoai}">
                    <option value="${item.ma}"
                            <c:if test="${item.ma == loaiSel.ma}">
                                selected="selected"
                            </c:if>
                            >${item.ten}</option>
                </c:forEach>
            </select>
        </span>
    </div>

    <div class="info">
        <span class="label">Tình trạng</span>
        <span>
            <select name="tinhtrang" id="tinhtrang">
                <c:forEach var="item" items="${dsTinhTrang}">
                    <option value="${item.ma}"
                            <c:if test="${item.ma == sanpham.tinhtrang.ma}">
                                selected="selected"
                            </c:if>
                            >${item.ten}
                    </option>
                </c:forEach>
            </select>
        </span>
    </div>

    <div class="info">
        <span class="label">Miêu tả chi tiết</span>
        <span>
            <textarea name="txtmieuta" cols="50" rows="7" id="txtmieuta">${sanpham.mota}</textarea>
        </span>
    </div>
    <div class="info">
        <span class="label">Hình ảnh</span>
        <span>            
            <img src="${sanpham.hinhanh}" width="71" height="54" alt=""  class="borderSp" onmouseover="doTooltip(event,'../image/product/${suasp.hinhanh}')" onmouseout="hideTip()"/>
        </span>
        <span><input type="text" name="txtImage" value="${sanpham.hinhanh}" style="width:400px"/></span>
    </div>

    <div class="command">
        <input type="hidden" name="masp" value="${sanpham.masp}"/>
        <input type="hidden" name="action" value="sua_submit" />
        <input type="submit" name="Submit" value="Cập nhật" class="button"/>
        <input type="button" name="Submit2" value="Quay lại"  onclick="window.location='sanpham.htm'" class="button"/>
        <span class="message"> ${message}</span>
    </div>

</form>